REPO  		= http://sobjc.googlecode.com/svn
SNAPSHOT 	= sobjc-snapshot
VERSION     = 0.4
TAG         = release-$(VERSION)
TAG_REPO    = $(REPO)/tags/$(TAG)
DIST_DIR    = dist
ARCHIVE 	= sobjc-$(VERSION)
ARCHIVE_DIR = $(DIST_DIR)/$(ARCHIVE)

dist: dist-clean
	mkdir -p $(DIST_DIR)
	svn export -q $(TAG_REPO) $(ARCHIVE_DIR)
	cd $(ARCHIVE_DIR)/doc/ja; make sobjc.html
	cd $(ARCHIVE_DIR); rm -rf Makefile doc/ja/Makefile doc/ja/sobjc.txt
	cd $(DIST_DIR); tar czf $(ARCHIVE).tar.gz $(ARCHIVE)

dist-clean:
	rm -rf $(DIST_DIR)

snapshot: snapshot-clean
	svn co -q $(REPO)/trunk $(SNAPSHOT)
	rm -rf $(SNAPSHOT)/doc $(SNAPSHOT)/Makefile
	tar czf $(SNAPSHOT).tar.gz $(SNAPSHOT)

snapshot-clean:
	rm -rf $(SNAPSHOT)

